Skip to content

Conversation

ahnpnl
Copy link
Contributor

@ahnpnl ahnpnl commented Sep 30, 2025

Summary

Inspired from Vite and Playwright, this PR introduces 2 new functions to jest-config: defineConfig and mergeConfig.

This will greatly improve DX that developers:

  • Don't need to know which interface to use
  • Get autocomplete OOTB
  • Don't need to use JSDOC comment for types

Test plan

  • Added unit tests and e2e tests
  • Green CI

Copy link

netlify bot commented Sep 30, 2025

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4f7105c
🔍 Latest deploy log https://app.netlify.com/projects/jestjs/deploys/68e7fab2e6bc240008754d88
😎 Deploy Preview https://deploy-preview-15844--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

pkg-pr-new bot commented Sep 30, 2025

Open in StackBlitz

babel-jest

npm i https://pkg.pr.new/babel-jest@15844

babel-plugin-jest-hoist

npm i https://pkg.pr.new/babel-plugin-jest-hoist@15844

babel-preset-jest

npm i https://pkg.pr.new/babel-preset-jest@15844

create-jest

npm i https://pkg.pr.new/create-jest@15844

@jest/diff-sequences

npm i https://pkg.pr.new/@jest/diff-sequences@15844

expect

npm i https://pkg.pr.new/expect@15844

@jest/expect-utils

npm i https://pkg.pr.new/@jest/expect-utils@15844

jest

npm i https://pkg.pr.new/jest@15844

jest-changed-files

npm i https://pkg.pr.new/jest-changed-files@15844

jest-circus

npm i https://pkg.pr.new/jest-circus@15844

jest-cli

npm i https://pkg.pr.new/jest-cli@15844

jest-config

npm i https://pkg.pr.new/jest-config@15844

@jest/console

npm i https://pkg.pr.new/@jest/console@15844

@jest/core

npm i https://pkg.pr.new/@jest/core@15844

@jest/create-cache-key-function

npm i https://pkg.pr.new/@jest/create-cache-key-function@15844

jest-diff

npm i https://pkg.pr.new/jest-diff@15844

jest-docblock

npm i https://pkg.pr.new/jest-docblock@15844

jest-each

npm i https://pkg.pr.new/jest-each@15844

@jest/environment

npm i https://pkg.pr.new/@jest/environment@15844

jest-environment-jsdom

npm i https://pkg.pr.new/jest-environment-jsdom@15844

@jest/environment-jsdom-abstract

npm i https://pkg.pr.new/@jest/environment-jsdom-abstract@15844

jest-environment-node

npm i https://pkg.pr.new/jest-environment-node@15844

@jest/expect

npm i https://pkg.pr.new/@jest/expect@15844

@jest/fake-timers

npm i https://pkg.pr.new/@jest/fake-timers@15844

@jest/get-type

npm i https://pkg.pr.new/@jest/get-type@15844

@jest/globals

npm i https://pkg.pr.new/@jest/globals@15844

jest-haste-map

npm i https://pkg.pr.new/jest-haste-map@15844

jest-jasmine2

npm i https://pkg.pr.new/jest-jasmine2@15844

jest-leak-detector

npm i https://pkg.pr.new/jest-leak-detector@15844

jest-matcher-utils

npm i https://pkg.pr.new/jest-matcher-utils@15844

jest-message-util

npm i https://pkg.pr.new/jest-message-util@15844

jest-mock

npm i https://pkg.pr.new/jest-mock@15844

@jest/pattern

npm i https://pkg.pr.new/@jest/pattern@15844

jest-phabricator

npm i https://pkg.pr.new/jest-phabricator@15844

jest-regex-util

npm i https://pkg.pr.new/jest-regex-util@15844

@jest/reporters

npm i https://pkg.pr.new/@jest/reporters@15844

jest-resolve

npm i https://pkg.pr.new/jest-resolve@15844

jest-resolve-dependencies

npm i https://pkg.pr.new/jest-resolve-dependencies@15844

jest-runner

npm i https://pkg.pr.new/jest-runner@15844

jest-runtime

npm i https://pkg.pr.new/jest-runtime@15844

@jest/schemas

npm i https://pkg.pr.new/@jest/schemas@15844

jest-snapshot

npm i https://pkg.pr.new/jest-snapshot@15844

@jest/snapshot-utils

npm i https://pkg.pr.new/@jest/snapshot-utils@15844

@jest/source-map

npm i https://pkg.pr.new/@jest/source-map@15844

@jest/test-result

npm i https://pkg.pr.new/@jest/test-result@15844

@jest/test-sequencer

npm i https://pkg.pr.new/@jest/test-sequencer@15844

@jest/transform

npm i https://pkg.pr.new/@jest/transform@15844

@jest/types

npm i https://pkg.pr.new/@jest/types@15844

jest-util

npm i https://pkg.pr.new/jest-util@15844

jest-validate

npm i https://pkg.pr.new/jest-validate@15844

jest-watcher

npm i https://pkg.pr.new/jest-watcher@15844

jest-worker

npm i https://pkg.pr.new/jest-worker@15844

pretty-format

npm i https://pkg.pr.new/pretty-format@15844

commit: 4f7105c

@ahnpnl ahnpnl force-pushed the feat/config-utils branch 3 times, most recently from 3496223 to 565fc14 Compare September 30, 2025 13:10
@ahnpnl ahnpnl marked this pull request as ready for review September 30, 2025 13:30
@ahnpnl
Copy link
Contributor Author

ahnpnl commented Sep 30, 2025

Hi @cpojer @SimenB would you pls help me to check this PR? Thank you 🙏

ahnpnl added 2 commits October 9, 2025 20:10
To start Jest doc, we need to run `fetchSupporters` first otherwise it's not possible to start doc server
@ahnpnl ahnpnl force-pushed the feat/config-utils branch from 565fc14 to 4f7105c Compare October 9, 2025 18:10
@ahnpnl ahnpnl changed the title feat(config): add defineConfig and mergeConfig functions feat(jest-config): add defineConfig and mergeConfig functions Oct 9, 2025
@SimenB
Copy link
Member

SimenB commented Oct 10, 2025

Yes, love this! I actually thought about this yesterday after seeing ESLint has added the same 👍

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

"scripts": {
"start": "docusaurus start",
"website:start": "yarn start",
"start": "yarn fetchSupporters && docusaurus start",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed when doing a fresh checkout of Jest repo and start the documentation, doc server will fail because it needs to have supporters to be available on disk so dev server can pick up.

It took me some time to figure out this issue. Therefore adding this to start command would help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants